package com.code.springbootwebsocket.controller.v2;

import com.code.springbootwebsocket.model.InMessage;
import com.code.springbootwebsocket.service.WebSocketService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.stereotype.Controller;

/**
 * @author: liyufei
 * @date: 2019-02-16 19:32
 */
@Controller
public class GameRankController {

    @Autowired
    private WebSocketService webSocketService;

    @MessageMapping("/v2/chat")
    public void gameRank(InMessage message) throws Exception {
        webSocketService.sendTopicMessage("/topic/game_rank", message);
    }

}
